class DockWidget():
    def __init__(self, dock):
        super(DockWidget, self).__init__()

        self.dock = dock
        self.dock.keyPressEvent = self.keyPressEventDock
        self.dock.close()
        self.dock.setFloating(True)

    def keyPressEventDock(self, QKeyEvent):
        self.dock.close() if QKeyEvent.key() == 16777216 else None

    def close(self): self.dock.close()

    def hide(self): self.dock.hide()

    def show(self): self.dock.show()

    def setStyleSheet(self, style): self.dock.setStyleSheet(style)

    def setFloating(self, flag): self.dock.setFloating(flag)

    def setWindowTitle(self, title): self.dock.setWindowTitle(title)

    def setGeometry(self, x, y, w, h): self.dock.setGeometry(x, y, w, h)

    def isWindow(self): return self.dock.isWindow()
    
    def activateWindow(self): self.dock.activateWindow()

    def setMinimumSize(self, w, h): self.dock.setMinimumSize(w, h)

    def setMaximumSize(self, w, h): self.dock.setMaximumSize(w, h)

    def isVisible(self): return self.dock.isVisible()

    def setFocus(self): self.dock.setFocus()

    def opening(self):
        self.show()
        self.activateWindow()
        self.setFocus()

    def opened(self, title):
        self.setWindowTitle(title)
        self.opening()
